import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/api/recommend/list',
    method: 'get',
    params: query
  })
}

export function fetchRecommend(id) {
  return request({
    url: '/api/recommend/detail',
    method: 'get',
    params: { id }
  })
}

export function createRecommend(data) {
  return request({
    url: '/api/recommend/create',
    method: 'post',
    data
  })
}

export function updateRecommend(data) {
  return request({
    url: '/api/recommend/update',
    method: 'post',
    data
  })
}

export function deleteRecommend(cateId) {
  return request({
    url: '/api/recommend/delete/' + cateId,
    method: 'post'
  })
}
